package com.dkha.common.enums;

import lombok.Getter;

/**
 * @version V1.0
 * @Description: TODO(布控任务类型)
 * All rights 成都电科慧安
 * @Title: ContralEnums
 * @Package com.dkha.common.enums
 * @author: panhui
 * @date: 2019/12/11 17:27
 * @Copyright: 成都电科慧安
 */
@Getter
public enum  ContralEnums {


    ARREST(0,"抓捕类"),
    MONITOR(1,"监控类"),
    PROMPT(2,"提示类");


    private Integer code;
    private String message;

    ContralEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ContralEnums getTypeByValue(Integer code)
    {
        if (null==code){
            return ARREST;
        }
        for (ContralEnums enums : ContralEnums.values()) {
            if (enums.getCode().intValue() == code.intValue()) {
                return enums;
            }
        }
        return ARREST;
    }
}
